package J5_20;

import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String n = in.next();
        if ((n.charAt(0)-'0') % 2 == 0) {
            System.out.println("noprime");
        } else {
            StringBuilder str = new StringBuilder();
            for (int i = 0; i < n.length(); i++) {
                str.append(n.charAt(i));
            }
            for (int i = str.length() - 2; i >= 0; i--) {
                str.append(n.charAt(i));
            }
            long cur = Long.valueOf(new String(str));
            if (isPri(cur)) {
                System.out.println("prime");
            } else {
                System.out.println("noprime");
            }
        }
    }
    static boolean isPri(long n) {
        if (n < 2) {
            return false;
        }
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }
}
